import Vue from 'vue'
import App from './App.vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import router from './router'
import './assets/css/index.scss'
import './assets/css/flipTimer.scss'
import store from './store/store'
import CommentEditor from 'comment-message-editor'

// tinymce 编辑器
import tinymce from 'tinymce'
import VueTinymce from '@packy-tang/vue-tinymce'
Vue.prototype.$tinymce = tinymce // 将全局tinymce对象指向给Vue作用域下
Vue.use(VueTinymce)              // 安装vue的tinymce组件

// 文章目录 vue-outline
// import outline from 'vue-outline'
// Vue.use(outline)

// 评论编辑框
Vue.component(CommentEditor.name, CommentEditor)


Vue.config.productionTip = false
Vue.use(ElementUI)

// export const remoteScript = Vue.component('remote-script', {
//
//   render: function (createElement) {
//     var self = this
//     return createElement('script', {
//       attrs: {
//         type: 'text/javascript',
//         src: this.src
//       },
//       on: {
//         load: function (event) {
//           self.$emit('load', event)
//         },
//         error: function (event) {
//           self.$emit('error', event)
//         },
//         readystatechange: function (event) {
//           if (this.readyState === 'complete') {
//             self.$emit('load', event)
//           }
//         }
//       }
//     })
//   },
//
//   props: {
//     src: {
//       type: String,
//       required: true
//     }
//   }
// })

//跳转前设置title
router.beforeEach((to, from, next) => {
  window.document.title = to.meta.title;
  next();
});

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')


